package net.cocotea.example.model;

import lombok.Data;
import lombok.experimental.Accessors;
import org.sagacity.sqltoy.config.annotation.Column;
import org.sagacity.sqltoy.config.annotation.Entity;
import org.sagacity.sqltoy.config.annotation.Id;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigInteger;
import java.time.LocalDateTime;

@Data
@Accessors(chain = true)
@Entity(tableName="sys_user",comment="系统用户表",pk_constraint="PRIMARY")
public class SysUser implements Serializable {

    @Serial
    private static final long serialVersionUID = 5406377277097985731L;
    /*---begin-auto-generate-don't-update-this-area--*/

    @Id(strategy="generator",generator="org.sagacity.sqltoy.plugins.id.impl.SnowflakeIdGenerator")
    @Column(name="id",comment="用户id",length=19L,type=java.sql.Types.BIGINT,nullable=false)
    private BigInteger id;

    @Column(name="username",comment="登录账号",length=30L,type=java.sql.Types.VARCHAR,nullable=false)
    private String username;

    @Column(name="nickname",comment="用户昵称",length=30L,type=java.sql.Types.VARCHAR,nullable=false)
    private String nickname;

    @Column(name="password",comment="密码",length=64L,type=java.sql.Types.VARCHAR,nullable=false)
    private String password;

    @Column(name="sex",comment="用户性别;0未知 1男 2女",length=3L,type=java.sql.Types.TINYINT,nullable=false)
    private Integer sex;

    @Column(name="email",comment="用户邮箱",length=128L,type=java.sql.Types.VARCHAR,nullable=true)
    private String email;

    @Column(name="mobile_phone",comment="手机号",length=20L,type=java.sql.Types.VARCHAR,nullable=true)
    private String mobilePhone;

    @Column(name="account_status",comment="账号状态;0停用 1正常 2冻结 3封禁",length=3L,type=java.sql.Types.TINYINT,nullable=false)
    private Integer accountStatus;

    @Column(name="avatar",comment="头像地址",length=255L,type=java.sql.Types.VARCHAR,nullable=true)
    private String avatar;

    @Column(name="last_login_ip",comment="最后登录ip",length=64L,type=java.sql.Types.VARCHAR,nullable=true)
    private String lastLoginIp;

    @Column(name="last_login_time",comment="最后登录时间",length=19L,type=java.sql.Types.DATE,nullable=true)
    private LocalDateTime lastLoginTime;

    @Column(name="create_by",comment="创建人",length=19L,type=java.sql.Types.BIGINT,nullable=false)
    private BigInteger createBy;

    @Column(name="create_time",comment="创建时间",length=19L,type=java.sql.Types.DATE,nullable=false)
    private LocalDateTime createTime;

    @Column(name="update_by",comment="更新人",length=19L,type=java.sql.Types.BIGINT,nullable=true)
    private BigInteger updateBy;

    @Column(name="update_time",comment="更新时间",length=19L,type=java.sql.Types.DATE,nullable=true)
    private LocalDateTime updateTime;

    @Column(name="is_deleted",comment="是否删除",length=3L,defaultValue="0",type=java.sql.Types.TINYINT,nullable=false)
    private Integer isDeleted;

    @Column(name="revision",comment="乐观锁",length=10L,type=java.sql.Types.INTEGER,nullable=true)
    private Integer revision;
    /** default constructor */
    public SysUser() {
    }

    /** pk constructor */
    public SysUser(BigInteger id)
    {
        this.id=id;
    }
    /*---end-auto-generate-don't-update-this-area--*/
}

